﻿using System.IO;
using Framework.Testing;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using NUnit.Framework;

namespace WebCrawler.Tests.Integration
{
    public class IntegrationTestData : MockedTestData
    {
    }

    public class IntegrationTestFixture : MockedTestFixture<IntegrationTestData>
    {
        private readonly IUnityContainer _rootContainer = new UnityContainer();

        public IUnityContainer RootContainer
        {
            get { return _rootContainer; }
        }

        [SetUp]
        public new void Setup()
        {
            RootContainer.LoadConfiguration("root");
        }

        protected static void ExpectFilesInDirectory(string tempDir, int expectedNumFiles)
        {
            var numFiles = Directory.GetFiles(tempDir).Length;
            Assert.AreEqual(expectedNumFiles, numFiles, "number of files");
        }
    }
}